package com.yuxi.enums;

/**
*    @author sunke
*    @Date 2023-10-13 10:05:05
*    @description 角色
*/
import com.yuxi.pubInter.EnumVO;
import java.util.ArrayList;
import java.util.List;

public enum AdminRoleIdEnum {

    CUSTOMER(1, "客服") ,
    FINANCE(2, "账务") ,
    MANAGE(3, "管理员") ; 




    private Integer type;
    private String desc;

    AdminRoleIdEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByType(Integer type) {
        if(type==null ){
            type=0;
        }
        for (AdminRoleIdEnum var : AdminRoleIdEnum.values()) {
            if (type==var.getType().intValue())
                return var.getDesc();
             }
        return AdminRoleIdEnum.values()[0].getDesc();
    }

    public static List<EnumVO> getDescs() {
        List list = new ArrayList();

        for (AdminRoleIdEnum var : AdminRoleIdEnum.values()) {
            EnumVO enumVO = new EnumVO();
            enumVO.setId(var.getType()+"");
            enumVO.setName(var.getDesc());
            list.add(enumVO);
        }


        return list;
    }

}
